package com.neusoft.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result<T> {
    private Integer code;
    private T data;
    private String msg;


    public static <T>  Result<T> success(){
        return new Result<>(0,null,"success!");
    }

    public static <T>  Result<T> success(T data){
        return new Result<>(0,data,"success!");
    }

    public static <T>  Result<T> fail(Integer code , String msg){
        return new Result<>(code,null,msg);
    }

}
